import { base } from '@/config'
import http from '@/utils/request'

const appraiseApi = {
  // 编辑评论
  editGoodsComment: params => {
    return http.postJson(`${base.goods}/comment/edit`, params)
  },
  // 获取评论列表
  getGoodsComment: params => {
    return http.get(`${base.goods}/comment/list`, { params })
  },
  // 删除评论
  deleteGoodsComment: id => {
    return http.post(`${base.goods}/comment/remove/${id}`)
  },
  // 获取评论详情
  getGoodsCommentDetail: id => {
    return http.get(`${base.goods}/comment/${id}`)
  },
  // 获取评论设置
  getGoodsCommentSetting: () => {
    return http.get(`${base.goods}/commentSetting/get`)
  },
  // 编辑评论设置
  editGoodsCommentSetting: params => {
    return http.postJson(`${base.goods}/commentSetting/edit`, params)
  }
}

export default appraiseApi
